const mongoose = require('mongoose')

const schema = new mongoose.Schema({
    //谁交的钱
    parentUser: {
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'User'
    },  
    //需要交的钱
    payMoney: {
        type: Number,
        require: true
    },
    //所属小区
    parentCell: {
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'Cell'
    },
    //所属楼饭
    parentFloor: {
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'Floor'
    },
    //是否交钱了
    isPay:{
        type: Number,
        require: true
    },
    //备注
    note:{
        type:String,
        require: true,
        default: "无"
    }
},{
    timestamps: true
})

module.exports = mongoose.model('UserMoney', schema)